package com.wenwei.sharebox.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.wenwei.sharebox.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/07/09 0009.
 */
public class NotifyMessageAdapter extends RecyclerView.Adapter<NotifyMessageAdapter.MyViewHolder> {

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new MyViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_notify_message, null));
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        if(position%2 == 0){
            holder.imageView.setBackgroundResource(R.drawable.icon_message_zu);
        }else {
            holder.imageView.setBackgroundResource(R.drawable.icon_message_buy);
        }
    }

    @Override
    public int getItemCount() {
        return 6;
    }

    public static class MyViewHolder extends RecyclerView.ViewHolder {
        @Bind(R.id.imageView)
        ImageView imageView;
        @Bind(R.id.textView9)
        TextView textView9;
        public MyViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }

}
